﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

namespace YJKRevitView
{
	public static class RequestHandler
	{
		public static void SetVisible(UIApplication uiapp, List<ElementId> es, bool vis)
		{
			if (es.Count > 0)
			{
				Autodesk.Revit.DB.View activeView = uiapp.ActiveUIDocument.Document.ActiveView;
				if (!vis)
				{
					Transaction transaction = new Transaction(uiapp.ActiveUIDocument.Document, "hide");
					transaction.Start();
					activeView.HideElements(es);
					transaction.Commit();
					return;
				}
				Transaction transaction2 = new Transaction(uiapp.ActiveUIDocument.Document, "unhide");
				transaction2.Start();
				activeView.UnhideElements(es);
				transaction2.Commit();
			}
		}

		public static void UpdateVisible()
		{
		}
	}
}
